#include "nlohmann/json.hpp"
#include <string>
#include <iostream>
using namespace std;
int main(){
    nlohmann::json jsonObject;
    jsonObject[0] = "key1"; // operator[](int) json对象是一个array 
    jsonObject[1] = 12345;
    jsonObject[2]["key1"] = "value1";
    jsonObject[3][0] = "hello";
    jsonObject.push_back("world");
    //jsonObject["key1"] = "value1";
    //错误写法，不能混淆 object 和 array
    string output;
    output = jsonObject.dump();//dump方法负责序列化
    cout << "output = " << output << "\n";
    return 0;
}

